package org.dromara.system.business.cases.controller;



import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.dromara.common.core.domain.R;
import org.dromara.system.business.cases.entity.CaseManager;
import org.dromara.system.business.cases.select.CaseSelect;
import org.dromara.system.business.cases.service.CaseManagerService;
import org.dromara.system.business.common.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.Serializable;
import java.util.List;

/**
 * (CaseManager)表控制层
 *
 * @author zms
 * @since 2025-02-08 14:56:36
 */
@RestController
@RequestMapping("caseManager")
public class CaseManagerController {
    /**
     * 服务对象
     */
    @Autowired
    private CaseManagerService caseManagerService;

    /**
     * 分页查询所有数据
     *
     * @param pageVo 分页对象
     * @param caseSelect 查询实体
     * @return 所有数据
     */
    @GetMapping
    public R selectAll(PageVo pageVo, CaseSelect caseSelect) {
        Page<CaseManager> page =caseManagerService.getPages(pageVo, caseSelect);
        return R.ok(page);
    }

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("{id}")
    public R selectOne(@PathVariable String id) {
        CaseManager caseManager = caseManagerService.getById(id);
        return R.ok(caseManager);
    }

    /**
     * 新增数据
     *
     * @param caseManager 实体对象
     * @return 新增结果
     */
    @PostMapping
    public R insert(@RequestBody CaseManager caseManager) {
        return R.ok();
    }

    /**
     * 修改数据
     *
     * @param caseManager 实体对象
     * @return 修改结果
     */
    @PutMapping
    public R update(@RequestBody CaseManager caseManager) {
        return R.ok();
    }

    /**
     * 删除数据
     *
     * @param idList 主键结合
     * @return 删除结果
     */
    @DeleteMapping
    public R delete(@RequestParam("idList") List<Long> idList) {
        return R.ok();
    }
}

